#include <iostream>
#include <cstring>
using namespace std;
int main()
{
 int h1=0, h2, h3, dg,i=0,s;
 char a;
 cin>>a;
 char am[a];
 if (am[0]=='z'){
    h1=0;}
 if (am[0]=='o'){
    h1=1;}
 if (am[0]=='t' and am[1]=='w'){
    h1=2;}
 if (am[0]=='t' and am[1]=='h'){
    h1=3;}
 if (am[0]=='f' and am[1]=='o'){
    h1=4;}
 if (am[0]=='f' and am[1]=='i'){
    h1=5;}
 if (am[0]=='s' and am[1]=='i'){
    h1=6;}
 if (am[0]=='s' and am[1]=='e'){
    h1=7;}
 if (am[0]=='e'){
    h1=8;}
 if (am[0]=='n'){
    h1=9;}

 strlen(am)==s;
for (i;i<=s;i++)
     if (am[i]=='1' or am[i]=='2' or am[i]=='3' or am[i]=='4' or am[i]=='5' or am[i]=='6' or am[i]=='7' or am[i]=='8' or am[i]=='9'){
        dg=1;
        cout<<" Wrong input"<<endl;
        break;}
 if (dg==0){
    cout << h1 << endl;}

}
